﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Objects.DataClasses;
using WA.Core.DomainModel;


[assembly: global::System.Data.Objects.DataClasses.EdmSchemaAttribute()]
namespace WA.Core.Employees.Model
{
    [EdmEntityType(Name = "SalaryCalculation", NamespaceName = "WA.Core.Employees.Model")]

    public class SalaryCalculation : BaseEntity<int>
    {
        private decimal grossSalary;
        private int employeeID;

        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(EntityKeyProperty = true, IsNullable = false)]
        public int SalaryCalculationID 
        {
            get
            {
                return base.ID;

            }
            set
            {
                this.PropertyChanging("SalaryCalculationID");
                base.ID = value;
                this.PropertyChanging("SalaryCalculationID");
            }
        }

        [global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(IsNullable = false)]
        public decimal GrossSalary
        {
            get { return grossSalary; }
            set
            {
                this.PropertyChanging("GrossSalary");
                grossSalary = value;
                this.PropertyChanged("GrossSalary");
            }

        }       
       
        public int EmployeeID 
        { 
            get
            {
                return employeeID;
            }
            set
            {
                this.PropertyChanging("EmployeeID");
                employeeID = value;
                this.PropertyChanging("EmployeeID");

                        
            }
        
        }

        [global::System.Data.Objects.DataClasses.EdmRelationshipNavigationPropertyAttribute("WA.Core.DomainModel", "EmployeeSalaryCalculation", "Employee")]
        public Employee Employee
        {
            get
            {
                return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Employee>("WA.Core.DomainModel.EmployeeSalaryCalculation", "Employee").Value;
            }
            set
            {
                ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Employee>("WA.Core.DomainModel.EmployeeSalaryCalculation", "Employee").Value = value;
            }
        }
       
         public global::System.Data.Objects.DataClasses.EntityReference<Employee> EmployeeReference
         {
             get
             {
                 return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference<Employee>("WA.Core.DomainModel.Employee", "Employee");
             }
             set
             {
                 if ((value != null))
                 {
                     ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedReference<Employee>("WA.Core.DomainModel.Employee", "Employee", value);
                 }
             }
         }
           
    }
}
